<template>
  <div class="map-wrap pr">
    <div class="map flex column pr">
      <item class="item" :count="7"></item>
      <div class="main-data flex">
        <div class="data-item flex-1 data-line">
          <div class="data-item-title">虚拟机(台)</div>
          <div class="data-item-count">{{ count.vmCount }}</div>
        </div>

        <div class="data-item flex-1 data-line">
          <div class="data-item-title">CPU(核)</div>
          <div class="data-item-count">{{ count.vmCpuCount }}</div>
        </div>
        <div class="data-item flex-1 data-line">
          <div class="data-item-title">内存(G)</div>
          <div class="data-item-count">{{ count.vmMemSize }}</div>
        </div>
        <div class="data-item flex-1">
          <div class="data-item-title">存储(T)</div>
          <div class="data-item-count">{{ count.vmDiskSize }}</div>
        </div>
      </div>
      <div class="flex-1">
        <map-box ref="map"></map-box>
      </div>
    </div>
  </div>
</template>
<script>
import mapBox from "../components/map";
import item from "../components/block.vue";

export default {
  components: { mapBox, item },
  computed: {
    count() {
      return this.$store.state.countAll;
    },
  },
  methods: {
    showFlyLayer(data) {
      this.$refs.map.showFlyLayer(data);
    },
     setDotPoint(data) {
      this.$refs.map.setDotPoint(data);
    },
  },
};
</script>
<style lang="less" scoped>
@import url("../styles/main.less");
.map-wrap {
  padding: 20px 0 10px 0;
  .map {
    height: 100%;
    width: 100%;
    .block-box;
    .main-data {
      height: 40px;
      padding: 20px 0;
      .data-item {
        text-align: center;
        .pr;
        .data-item-title {
          .main-color;
          font-size: 14px;
        }
        .data-item-count {
          .data-color;
          font-size: 20px;
          font-weight: bold;
        }
      }
    }
  }
}
.data-line {
  &::after {
    position: absolute;
    content: " ";
    right: 0;
    top: 10px;
    height: 60%;
    width: 1px;
    background: #00b4ff;
  }
}
</style>